package com.company;

public class Test21阶乘 {
    public static void main(String[] args) {
        System.out.println(jie(1));
        System.out.println(jie(4));
    }

    /**
     * 阶乘
     * @param x
     * @return
     */
    public static  int jie(int x){
        if(x<=1){
            return 1;
        }else {
            return jie(x-1)*x;
        }
    }
}
